{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "6906ebfb",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pickle\n",
    "import json\n",
    "import csv"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "92f9ec2f",
   "metadata": {},
   "outputs": [],
   "source": [
    "pickle_file = open(\"data.pkl\", \"rb\")\n",
    "csv_file = open(\"data.csv\", \"r\")\n",
    "json_file = open(\"data.json\", \"r\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "5e7e9b49",
   "metadata": {},
   "outputs": [],
   "source": [
    "json_data = json.load(json_file)\n",
    "csv_data = list(csv.reader(csv_file))\n",
    "pickle_data = pickle.load(pickle_file)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "8b458a3f",
   "metadata": {
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "full_data = {}\n",
    "\n",
    "for col in range(1, len(csv_data[0])):\n",
    "    rows = {}\n",
    "    for row in range(1, len(csv_data)):\n",
    "        rows[csv_data[row][0]] = csv_data[row][col]\n",
    "    full_data[csv_data[0][col]] = rows"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "ced5efb4",
   "metadata": {},
   "outputs": [],
   "source": [
    "for k in json_data.keys():\n",
    "    full_data[k].update(json_data[k])\n",
    "for k in pickle_data.keys():\n",
    "    full_data[k].update(pickle_data[k])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "f5e5cd54",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Name': {'0': 'Hillary Benton',\n",
       "  '1': 'Morgan Y. Little',\n",
       "  '2': 'Camden Z. Blair',\n",
       "  '3': 'Alexandra E. Saunders',\n",
       "  '4': 'Hanae P. Walsh',\n",
       "  '5': 'Jescie Sargent',\n",
       "  '6': 'Kessie Morgan',\n",
       "  '7': 'Bevis M. Santos',\n",
       "  '8': 'Flynn Alston',\n",
       "  '9': 'Charles F. Crawford',\n",
       "  '10': 'Cairo Wolfe',\n",
       "  '11': 'Elijah Myers',\n",
       "  '12': 'Thane Burch',\n",
       "  '13': 'Katelyn Munoz',\n",
       "  '14': 'Genevieve Holland',\n",
       "  '15': 'Wesley Z. Sharp',\n",
       "  '16': 'Tatyana H. French',\n",
       "  '17': 'Meredith F. Clayton',\n",
       "  '18': 'Rajah Carrillo',\n",
       "  '19': 'Gabriel Richmond',\n",
       "  '20': 'Paul Merrill',\n",
       "  '21': 'Brynne S. Barr',\n",
       "  '22': 'Cyrus Buckley',\n",
       "  '23': 'Chloe Burnett',\n",
       "  '24': 'Zachery Wilcox',\n",
       "  '25': 'Casey Mcgowan',\n",
       "  '26': 'Cole X. Hopper',\n",
       "  '27': 'Tara Bender',\n",
       "  '28': 'Malik Grimes',\n",
       "  '29': 'Ulla Russo',\n",
       "  '30': 'Colby Moran',\n",
       "  '31': 'Maggy Wooten',\n",
       "  '32': 'Cameron Guthrie',\n",
       "  '33': 'Gail Villarreal',\n",
       "  '34': 'Harding Salinas',\n",
       "  '35': 'Idona W. Bonner',\n",
       "  '36': 'Warren Castillo',\n",
       "  '37': 'Clayton Harmon',\n",
       "  '38': 'Alana Vasquez',\n",
       "  '39': 'Mason R. Trujillo',\n",
       "  40: 'Garrison Lindsey',\n",
       "  41: 'Jenna Mercado',\n",
       "  42: 'Drake Savage',\n",
       "  43: 'Rana Z. Colon',\n",
       "  44: 'Melodie Knox',\n",
       "  45: 'Cooper T. Horton',\n",
       "  46: 'Eaton Nelson',\n",
       "  47: 'Lucian W. Lynn',\n",
       "  48: 'Sydney Anderson',\n",
       "  49: 'Jane Joyner',\n",
       "  50: 'Yen P. Browning',\n",
       "  51: 'Katell Simmons',\n",
       "  52: 'Freya B. Fischer',\n",
       "  53: 'Rama W. Mack',\n",
       "  54: 'Lawrence Z. Carrillo',\n",
       "  55: 'Quyn Serrano',\n",
       "  56: 'Indira L. Mccormick',\n",
       "  57: 'Rina W. Harris',\n",
       "  58: 'Cherokee George',\n",
       "  59: 'Michael Riddle',\n",
       "  60: 'Kay Rice',\n",
       "  61: 'Arden Leonard',\n",
       "  62: 'Chantale Sharpe',\n",
       "  63: 'Calvin Herman',\n",
       "  64: 'Walter R. Gaines',\n",
       "  65: 'Berk Finley',\n",
       "  66: 'Timothy Chambers',\n",
       "  67: 'Ariana M. Olson',\n",
       "  68: 'Mason E. Kelly',\n",
       "  69: 'Keane Stein',\n",
       "  70: 'Ginger Morse',\n",
       "  71: 'Maggy Cotton',\n",
       "  72: 'Talon R. May',\n",
       "  73: 'Devin L. Boone',\n",
       "  74: 'Orli E. Baxter',\n",
       "  75: 'Wing Velazquez',\n",
       "  76: 'Inez Simon',\n",
       "  77: 'Kyle Leonard',\n",
       "  78: 'Selma Christensen',\n",
       "  79: 'Gwendolyn Crosby',\n",
       "  80: 'Gary Alvarez',\n",
       "  81: 'Knox L. Cash',\n",
       "  82: 'Drake P. Guerrero',\n",
       "  83: 'Blossom Chandler',\n",
       "  84: 'Joan O. Ingram',\n",
       "  85: 'Buffy R. Austin',\n",
       "  86: 'Yoko M. Mcgowan',\n",
       "  87: 'Walker Q. Wolfe',\n",
       "  88: 'Blake Cross',\n",
       "  89: 'Naida Guthrie',\n",
       "  90: 'Yardley Singleton',\n",
       "  91: 'Lenore M. Boyer',\n",
       "  92: 'Edan Cortez',\n",
       "  93: 'Quintessa T. Martinez',\n",
       "  94: 'Reuben Skinner',\n",
       "  95: 'Yoshio Leblanc',\n",
       "  96: 'Rebecca French',\n",
       "  97: 'Shana K. Kerr',\n",
       "  98: 'Gemma Leonard',\n",
       "  99: 'Adara Estrada'},\n",
       " 'Phone': {'0': '1-243-669-7472',\n",
       "  '1': '155-3483',\n",
       "  '2': '123-5058',\n",
       "  '3': '1-637-740-7614',\n",
       "  '4': '901-2461',\n",
       "  '5': '265-1176',\n",
       "  '6': '945-0713',\n",
       "  '7': '227-9994',\n",
       "  '8': '398-8097',\n",
       "  '9': '791-5111',\n",
       "  '10': '1-930-942-2322',\n",
       "  '11': '1-238-336-4864',\n",
       "  '12': '1-894-978-3696',\n",
       "  '13': '220-5054',\n",
       "  '14': '992-6968',\n",
       "  '15': '1-960-740-2261',\n",
       "  '16': '1-120-782-6047',\n",
       "  '17': '425-7583',\n",
       "  '18': '1-576-789-5730',\n",
       "  '19': '1-387-932-2096',\n",
       "  '20': '1-313-739-3854',\n",
       "  '21': '939-4818',\n",
       "  '22': '266-3123',\n",
       "  '23': '828-0406',\n",
       "  '24': '1-611-756-4723',\n",
       "  '25': '1-155-558-4461',\n",
       "  '26': '1-328-505-0545',\n",
       "  '27': '1-757-378-4079',\n",
       "  '28': '793-4359',\n",
       "  '29': '662-7778',\n",
       "  '30': '1-788-230-1991',\n",
       "  '31': '912-7242',\n",
       "  '32': '988-2217',\n",
       "  '33': '1-405-823-4207',\n",
       "  '34': '1-505-843-5401',\n",
       "  '35': '283-6921',\n",
       "  '36': '1-250-875-9104',\n",
       "  '37': '1-609-380-9257',\n",
       "  '38': '1-853-288-4269',\n",
       "  '39': '172-5777',\n",
       "  40: '420-1477',\n",
       "  41: '102-2189',\n",
       "  42: '1-790-105-7695',\n",
       "  43: '486-7539',\n",
       "  44: '1-479-861-6093',\n",
       "  45: '768-1000',\n",
       "  46: '746-8562',\n",
       "  47: '1-392-783-0634',\n",
       "  48: '1-610-717-0447',\n",
       "  49: '1-131-574-3183',\n",
       "  50: '473-1433',\n",
       "  51: '1-647-852-3590',\n",
       "  52: '514-9914',\n",
       "  53: '1-849-217-6292',\n",
       "  54: '352-3711',\n",
       "  55: '1-450-807-5530',\n",
       "  56: '1-330-764-3846',\n",
       "  57: '760-1654',\n",
       "  58: '1-722-165-1370',\n",
       "  59: '476-0145',\n",
       "  60: '477-5481',\n",
       "  61: '383-6541',\n",
       "  62: '1-600-834-9076',\n",
       "  63: '1-461-665-6848',\n",
       "  64: '370-5831',\n",
       "  65: '1-765-752-4793',\n",
       "  66: '819-2872',\n",
       "  67: '447-5000',\n",
       "  68: '1-896-767-7525',\n",
       "  69: '457-2683',\n",
       "  70: '1-228-310-1687',\n",
       "  71: '1-541-405-3049',\n",
       "  72: '143-7688',\n",
       "  73: '1-132-242-8605',\n",
       "  74: '371-7491',\n",
       "  75: '354-5776',\n",
       "  76: '461-0691',\n",
       "  77: '179-3944',\n",
       "  78: '978-6407',\n",
       "  79: '692-9172',\n",
       "  80: '1-692-738-4449',\n",
       "  81: '535-9704',\n",
       "  82: '250-6382',\n",
       "  83: '142-2607',\n",
       "  84: '1-889-203-6592',\n",
       "  85: '413-3678',\n",
       "  86: '1-731-637-5890',\n",
       "  87: '1-240-595-6907',\n",
       "  88: '979-7498',\n",
       "  89: '1-138-699-9182',\n",
       "  90: '945-1641',\n",
       "  91: '513-0044',\n",
       "  92: '1-223-433-5209',\n",
       "  93: '1-672-341-8336',\n",
       "  94: '1-790-135-9618',\n",
       "  95: '1-508-613-2127',\n",
       "  96: '397-3408',\n",
       "  97: '354-7392',\n",
       "  98: '175-7956',\n",
       "  99: '1-893-111-1453'},\n",
       " 'Address': {'0': '144-1225 In Road',\n",
       "  '1': 'Ap #909-6656 Ac St.',\n",
       "  '2': 'P.O. Box 441, 6183 Ligula St.',\n",
       "  '3': '305-496 Morbi Rd.',\n",
       "  '4': '7058 Dapibus St.',\n",
       "  '5': '421-5501 Cursus. St.',\n",
       "  '6': 'Ap #481-6631 Vehicula Rd.',\n",
       "  '7': 'P.O. Box 575, 4033 Mi St.',\n",
       "  '8': 'Ap #763-5990 Nec, Av.',\n",
       "  '9': 'Ap #841-1623 Vitae Avenue',\n",
       "  '10': '9269 Libero Ave',\n",
       "  '11': 'P.O. Box 677, 2311 Aliquet. Road',\n",
       "  '12': '7438 Amet, Rd.',\n",
       "  '13': 'P.O. Box 432, 9085 Nulla Ave',\n",
       "  '14': '1768 Magna. Road',\n",
       "  '15': 'P.O. Box 497, 8354 Habitant St.',\n",
       "  '16': '217-9163 Lobortis Road',\n",
       "  '17': 'Ap #929-9420 Vivamus Rd.',\n",
       "  '18': '910-8300 Varius Rd.',\n",
       "  '19': '7458 Sapien. St.',\n",
       "  '20': '916-8087 Vehicula Rd.',\n",
       "  '21': '878-2231 Suspendisse Rd.',\n",
       "  '22': 'P.O. Box 572, 7680 Ullamcorper Ave',\n",
       "  '23': '563-4105 Donec Avenue',\n",
       "  '24': '462-2112 In Rd.',\n",
       "  '25': '420-7327 Facilisis Street',\n",
       "  '26': '561-7476 Eget St.',\n",
       "  '27': '1247 Nonummy Rd.',\n",
       "  '28': 'Ap #603-3303 Libero. St.',\n",
       "  '29': 'P.O. Box 975, 4593 Ante. Street',\n",
       "  '30': '3696 Augue Ave',\n",
       "  '31': 'P.O. Box 365, 6109 Metus. Rd.',\n",
       "  '32': 'Ap #861-8699 Non Ave',\n",
       "  '33': '371-7266 Tortor Avenue',\n",
       "  '34': '4167 Nunc Ave',\n",
       "  '35': 'Ap #302-2966 Cum Av.',\n",
       "  '36': 'Ap #275-2917 Curabitur Rd.',\n",
       "  '37': '6930 Duis Road',\n",
       "  '38': '1511 Lobortis Ave',\n",
       "  '39': 'Ap #711-213 Sagittis Avenue',\n",
       "  40: 'P.O. Box 466, 7919 In Av.',\n",
       "  41: 'P.O. Box 484, 9648 Sit Avenue',\n",
       "  42: 'P.O. Box 254, 2688 Luctus, Street',\n",
       "  43: 'Ap #682-9992 Neque Rd.',\n",
       "  44: '245-8811 Ut St.',\n",
       "  45: 'P.O. Box 383, 139 A Ave',\n",
       "  46: '7989 Magna Rd.',\n",
       "  47: '7312 Tristique St.',\n",
       "  48: 'P.O. Box 720, 9179 Fermentum Street',\n",
       "  49: '200-5702 Mollis St.',\n",
       "  50: 'Ap #221-1593 Fringilla St.',\n",
       "  51: 'P.O. Box 133, 5382 Enim Ave',\n",
       "  52: 'Ap #869-5869 Neque Avenue',\n",
       "  53: '2992 Vitae Rd.',\n",
       "  54: '6427 Eros Avenue',\n",
       "  55: 'P.O. Box 133, 6862 Diam Road',\n",
       "  56: 'P.O. Box 679, 7373 Mollis Ave',\n",
       "  57: 'P.O. Box 642, 2289 Volutpat. Street',\n",
       "  58: '221-3908 Pellentesque Av.',\n",
       "  59: '581-1223 Aliquam Rd.',\n",
       "  60: '2398 Lectus, Road',\n",
       "  61: '1274 Nullam St.',\n",
       "  62: '1229 Nisl. Av.',\n",
       "  63: '263-4846 Sed St.',\n",
       "  64: '3247 Parturient Ave',\n",
       "  65: '6138 Faucibus Ave',\n",
       "  66: '865-2066 Vel Rd.',\n",
       "  67: '173-4952 Pede, Avenue',\n",
       "  68: '593 Turpis. Av.',\n",
       "  69: '567-6664 Egestas St.',\n",
       "  70: 'P.O. Box 618, 8055 Integer St.',\n",
       "  71: '7304 Euismod Avenue',\n",
       "  72: '890-4439 Varius. Avenue',\n",
       "  73: '1488 Dignissim Ave',\n",
       "  74: '1506 Egestas Rd.',\n",
       "  75: '859-3576 Tincidunt Street',\n",
       "  76: 'Ap #788-4701 Aliquet St.',\n",
       "  77: '685-2553 Ultrices Avenue',\n",
       "  78: 'Ap #595-189 Malesuada Road',\n",
       "  79: '997 Posuere Rd.',\n",
       "  80: 'Ap #890-8397 Euismod Ave',\n",
       "  81: 'P.O. Box 469, 4278 Condimentum Rd.',\n",
       "  82: '6247 Aliquet Av.',\n",
       "  83: '7121 Diam. Rd.',\n",
       "  84: '8198 Curae; Av.',\n",
       "  85: '203-4493 A Road',\n",
       "  86: 'P.O. Box 881, 7563 Nisl. Av.',\n",
       "  87: '482-4531 Mauris Rd.',\n",
       "  88: 'Ap #678-3509 Nascetur Av.',\n",
       "  89: 'P.O. Box 656, 5397 Gravida. Ave',\n",
       "  90: 'Ap #815-7648 Non Rd.',\n",
       "  91: 'Ap #836-7039 Lorem Avenue',\n",
       "  92: '159-6608 Eu, St.',\n",
       "  93: '8916 Pede St.',\n",
       "  94: 'Ap #810-9918 Enim Street',\n",
       "  95: '177-9263 Vitae Ave',\n",
       "  96: '870-7596 Eros Rd.',\n",
       "  97: 'Ap #215-8596 Cursus Ave',\n",
       "  98: 'P.O. Box 634, 4298 Elit. Rd.',\n",
       "  99: '624-5679 Nulla. Rd.'},\n",
       " 'City': {'0': 'Navsari',\n",
       "  '1': 'Kitimat',\n",
       "  '2': 'Casanova Elvo',\n",
       "  '3': 'Biggleswade',\n",
       "  '4': 'Dhuy',\n",
       "  '5': 'Tulsa',\n",
       "  '6': 'Pedro Aguirre Cerda',\n",
       "  '7': 'Saint-Vincent',\n",
       "  '8': 'Tir煤a',\n",
       "  '9': 'Hindupur',\n",
       "  '10': 'Whitchurch',\n",
       "  '11': 'Port Harcourt',\n",
       "  '12': 'Algeciras',\n",
       "  '13': 'Requ铆noa',\n",
       "  '14': 'Moose Jaw',\n",
       "  '15': 'Bear',\n",
       "  '16': 'Salles',\n",
       "  '17': 'Friedberg',\n",
       "  '18': 'Bertiolo',\n",
       "  '19': 'Tropea',\n",
       "  '20': 'Le Mans',\n",
       "  '21': 'Wilhelmshaven',\n",
       "  '22': 'Sangli',\n",
       "  '23': 'Wabamun',\n",
       "  '24': 'Barddhaman',\n",
       "  '25': 'Pfungstadt',\n",
       "  '26': 'Saint John',\n",
       "  '27': 'Avellino',\n",
       "  '28': 'Winnipeg',\n",
       "  '29': 'Vitória da Conquista',\n",
       "  '30': 'Hualpén',\n",
       "  '31': 'Kapuskasing',\n",
       "  '32': 'Pontypridd',\n",
       "  '33': 'Saint-Remy-Geest',\n",
       "  '34': 'Arsimont',\n",
       "  '35': 'Nieuwenrode',\n",
       "  '36': 'La Baie',\n",
       "  '37': 'College',\n",
       "  '38': 'Richmond Hill',\n",
       "  '39': 'Quinta Normal',\n",
       "  40: 'Dunbar',\n",
       "  41: 'Pollena Trocchia',\n",
       "  42: 'Hastings',\n",
       "  43: 'Gespeg',\n",
       "  44: 'Whitehorse',\n",
       "  45: 'Fernie',\n",
       "  46: 'Ludlow',\n",
       "  47: 'Tirrases',\n",
       "  48: 'Ingolstadt',\n",
       "  49: 'HavrŽ',\n",
       "  50: 'Gentbrugge',\n",
       "  51: 'Rionero in Vulture',\n",
       "  52: 'Pudahuel',\n",
       "  53: 'Moricone',\n",
       "  54: 'Northumberland',\n",
       "  55: 'Lagonegro',\n",
       "  56: 'Rampur',\n",
       "  57: 'Dolceacqua',\n",
       "  58: 'Ourense',\n",
       "  59: 'Logan City',\n",
       "  60: 'Rutten',\n",
       "  61: 'Esslingen',\n",
       "  62: 'Windsor',\n",
       "  63: 'Castel Maggiore',\n",
       "  64: 'Kitchener',\n",
       "  65: 'Cavallino',\n",
       "  66: 'Dordrecht',\n",
       "  67: 'Zwevegem',\n",
       "  68: 'Fraser-Fort George',\n",
       "  69: 'Burgos',\n",
       "  70: 'Bosa',\n",
       "  71: 'Sommariva Perno',\n",
       "  72: 'Richmond',\n",
       "  73: 'Teruel',\n",
       "  74: 'Piła',\n",
       "  75: 'Oostkamp',\n",
       "  76: 'Chaitén',\n",
       "  77: 'Placilla',\n",
       "  78: 'Mira Bhayandar',\n",
       "  79: 'San Miguel',\n",
       "  80: 'Westende',\n",
       "  81: 'Gönen',\n",
       "  82: 'Caerphilly',\n",
       "  83: 'Illapel',\n",
       "  84: 'Baton Rouge',\n",
       "  85: 'Herentals',\n",
       "  86: 'Bihain',\n",
       "  87: 'Schepdaal',\n",
       "  88: 'Albany',\n",
       "  89: 'Tulita',\n",
       "  90: 'Duffel',\n",
       "  91: 'Attimis',\n",
       "  92: 'High Level',\n",
       "  93: 'Rothesay',\n",
       "  94: 'Essex',\n",
       "  95: 'Redwater',\n",
       "  96: 'Pocatello',\n",
       "  97: 'Toronto',\n",
       "  98: 'Cuccaro Vetere',\n",
       "  99: 'Gijzelbrechtegem'},\n",
       " 'Country': {'0': 'Togo',\n",
       "  '1': 'Nauru',\n",
       "  '2': 'Palestine, State of',\n",
       "  '3': 'Malawi',\n",
       "  '4': 'Qatar',\n",
       "  '5': 'Holy See (Vatican City State)',\n",
       "  '6': 'Bonaire, Sint Eustatius and Saba',\n",
       "  '7': 'Kuwait',\n",
       "  '8': 'Romania',\n",
       "  '9': 'South Georgia and The South Sandwich Islands',\n",
       "  '10': 'Lesotho',\n",
       "  '11': 'Kyrgyzstan',\n",
       "  '12': 'Anguilla',\n",
       "  '13': 'Congo (Brazzaville)',\n",
       "  '14': 'Uruguay',\n",
       "  '15': 'Cayman Islands',\n",
       "  '16': 'Eritrea',\n",
       "  '17': 'Czech Republic',\n",
       "  '18': 'Afghanistan',\n",
       "  '19': 'Cambodia',\n",
       "  '20': 'Somalia',\n",
       "  '21': 'Samoa',\n",
       "  '22': 'Taiwan',\n",
       "  '23': 'Morocco',\n",
       "  '24': 'Hong Kong',\n",
       "  '25': 'Iran',\n",
       "  '26': 'Macao',\n",
       "  '27': 'Dominica',\n",
       "  '28': 'Congo (Brazzaville)',\n",
       "  '29': 'Slovakia',\n",
       "  '30': 'France',\n",
       "  '31': 'Indonesia',\n",
       "  '32': 'Turks and Caicos Islands',\n",
       "  '33': 'Marshall Islands',\n",
       "  '34': 'Montserrat',\n",
       "  '35': 'Faroe Islands',\n",
       "  '36': 'Ireland',\n",
       "  '37': 'United States',\n",
       "  '38': 'Israel',\n",
       "  '39': 'Sudan',\n",
       "  40: 'Zambia',\n",
       "  41: 'Burkina Faso',\n",
       "  42: 'Tunisia',\n",
       "  43: 'Canada',\n",
       "  44: 'Norway',\n",
       "  45: 'Israel',\n",
       "  46: 'Cocos (Keeling) Islands',\n",
       "  47: 'Western Sahara',\n",
       "  48: 'Saint Vincent and The Grenadines',\n",
       "  49: 'Austria',\n",
       "  50: 'Isle of Man',\n",
       "  51: 'Hong Kong',\n",
       "  52: 'Rwanda',\n",
       "  53: 'Jamaica',\n",
       "  54: 'Latvia',\n",
       "  55: 'Ireland',\n",
       "  56: 'Saint Pierre and Miquelon',\n",
       "  57: 'Ghana',\n",
       "  58: 'Ukraine',\n",
       "  59: 'Guatemala',\n",
       "  60: 'Isle of Man',\n",
       "  61: 'Italy',\n",
       "  62: 'Mauritius',\n",
       "  63: 'Romania',\n",
       "  64: 'Niger',\n",
       "  65: 'Chile',\n",
       "  66: 'Egypt',\n",
       "  67: 'Dominican Republic',\n",
       "  68: 'Uganda',\n",
       "  69: 'Turks and Caicos Islands',\n",
       "  70: 'Anguilla',\n",
       "  71: 'Kyrgyzstan',\n",
       "  72: 'Turkmenistan',\n",
       "  73: 'Switzerland',\n",
       "  74: 'Croatia',\n",
       "  75: 'Mayotte',\n",
       "  76: 'Antigua and Barbuda',\n",
       "  77: 'Botswana',\n",
       "  78: 'Montserrat',\n",
       "  79: 'Albania',\n",
       "  80: 'Dominican Republic',\n",
       "  81: 'American Samoa',\n",
       "  82: 'Guyana',\n",
       "  83: 'Czech Republic',\n",
       "  84: 'Wallis and Futuna',\n",
       "  85: 'Iraq',\n",
       "  86: 'Guinea',\n",
       "  87: 'Moldova',\n",
       "  88: 'Sint Maarten',\n",
       "  89: 'Sudan',\n",
       "  90: 'Botswana',\n",
       "  91: 'Venezuela',\n",
       "  92: 'Algeria',\n",
       "  93: 'Tajikistan',\n",
       "  94: 'Bahamas',\n",
       "  95: 'Bahamas',\n",
       "  96: 'Northern Mariana Islands',\n",
       "  97: 'Estonia',\n",
       "  98: 'Saudi Arabia',\n",
       "  99: 'Kyrgyzstan'},\n",
       " 'Email': {'0': 'rutrum.magna.Cras@eudolor.edu',\n",
       "  '1': 'pede.sagittis.augue@quis.ca',\n",
       "  '2': 'consectetuer.rhoncus.Nullam@ultrices.org',\n",
       "  '3': 'dui.Fusce@duinecurna.org',\n",
       "  '4': 'Morbi@tinciduntpedeac.com',\n",
       "  '5': 'non.egestas.a@ullamcorper.co.uk',\n",
       "  '6': 'est@vitaeeratVivamus.net',\n",
       "  '7': 'Nunc@Aliquamfringilla.com',\n",
       "  '8': 'Nunc.pulvinar@Phasellusdapibus.edu',\n",
       "  '9': 'dis.parturient@nectellusNunc.net',\n",
       "  '10': 'sociis.natoque@arcuVestibulumante.org',\n",
       "  '11': 'tempus.risus@posuereat.net',\n",
       "  '12': 'lobortis.quis.pede@Namligula.edu',\n",
       "  '13': 'Vivamus.nisi.Mauris@fermentumarcu.edu',\n",
       "  '14': 'Maecenas.malesuada@euultrices.co.uk',\n",
       "  '15': 'et@sedsapien.ca',\n",
       "  '16': 'Curabitur@magna.com',\n",
       "  '17': 'elit.pharetra@dui.co.uk',\n",
       "  '18': 'sapien.gravida.non@cursuset.net',\n",
       "  '19': 'nunc.nulla.vulputate@anteblanditviverra.co.uk',\n",
       "  '20': 'diam.Pellentesque@suscipitest.ca',\n",
       "  '21': 'euismod.et.commodo@nisi.co.uk',\n",
       "  '22': 'accumsan.laoreet.ipsum@Quisqueimperdiet.ca',\n",
       "  '23': 'nec.orci.Donec@Suspendisse.co.uk',\n",
       "  '24': 'eget@tinciduntaliquamarcu.com',\n",
       "  '25': 'tellus.faucibus.leo@Sedpharetrafelis.org',\n",
       "  '26': 'urna@Lorem.net',\n",
       "  '27': 'libero.Integer@ligulaelitpretium.org',\n",
       "  '28': 'Donec.nibh.enim@consectetuercursuset.org',\n",
       "  '29': 'mauris.sit.amet@blanditatnisi.ca',\n",
       "  '30': 'eu@Aenean.edu',\n",
       "  '31': 'facilisis.eget.ipsum@consequat.com',\n",
       "  '32': 'ipsum@liberoDonec.net',\n",
       "  '33': 'Curabitur.dictum.Phasellus@maurisipsum.edu',\n",
       "  '34': 'Fusce.aliquam@velesttempor.edu',\n",
       "  '35': 'elementum.lorem@convallisdolor.co.uk',\n",
       "  '36': 'Aenean@ametrisus.com',\n",
       "  '37': 'bibendum@interdumfeugiatSed.edu',\n",
       "  '38': 'faucibus.id.libero@egestas.net',\n",
       "  '39': 'egestas@malesuadamalesuadaInteger.ca',\n",
       "  40: 'ipsum.ac@quam.net',\n",
       "  41: 'Nulla.facilisis.Suspendisse@urnanec.net',\n",
       "  42: 'quis.accumsan.convallis@fringilla.edu',\n",
       "  43: 'rutrum.non.hendrerit@etlacinia.com',\n",
       "  44: 'arcu@laciniaorciconsectetuer.ca',\n",
       "  45: 'sit@eros.ca',\n",
       "  46: 'eu@aenim.ca',\n",
       "  47: 'purus.Duis.elementum@ut.org',\n",
       "  48: 'ante.ipsum.primis@ornare.org',\n",
       "  49: 'magna.sed.dui@diamPellentesquehabitant.com',\n",
       "  50: 'enim@nuncinterdum.edu',\n",
       "  51: 'dui.lectus@erat.org',\n",
       "  52: 'Cras@dictumeu.org',\n",
       "  53: 'neque.vitae@nullamagna.edu',\n",
       "  54: 'Integer.vitae@arcu.org',\n",
       "  55: 'tincidunt@egestasadui.co.uk',\n",
       "  56: 'eleifend@purus.ca',\n",
       "  57: 'eget.venenatis.a@Curae.com',\n",
       "  58: 'amet.risus@risusaultricies.co.uk',\n",
       "  59: 'In@ornarelectusjusto.net',\n",
       "  60: 'ornare@egestas.co.uk',\n",
       "  61: 'pede.Suspendisse.dui@ullamcorper.ca',\n",
       "  62: 'Suspendisse.commodo.tincidunt@placerat.ca',\n",
       "  63: 'iaculis.lacus@ipsumprimis.com',\n",
       "  64: 'sit@risusDonec.net',\n",
       "  65: 'sapien.molestie@nonbibendum.edu',\n",
       "  66: 'purus.sapien@odioAliquamvulputate.edu',\n",
       "  67: 'augue.malesuada@magnisdisparturient.co.uk',\n",
       "  68: 'Maecenas.mi@tortordictumeu.org',\n",
       "  69: 'rhoncus.Donec@placerataugueSed.com',\n",
       "  70: 'in@eratEtiam.net',\n",
       "  71: 'amet@facilisisvitae.ca',\n",
       "  72: 'sit.amet.nulla@orciluctus.org',\n",
       "  73: 'nec.tempus.scelerisque@ettristiquepellentesque.ca',\n",
       "  74: 'eget.tincidunt@Curabiturvellectus.net',\n",
       "  75: 'consequat.nec.mollis@vitaeodiosagittis.edu',\n",
       "  76: 'laoreet@magnaUt.org',\n",
       "  77: 'Ut.nec@pedeSuspendissedui.edu',\n",
       "  78: 'ut@Maecenasiaculis.co.uk',\n",
       "  79: 'molestie.orci.tincidunt@feugiat.org',\n",
       "  80: 'Donec@consequat.co.uk',\n",
       "  81: 'nunc@erat.co.uk',\n",
       "  82: 'Maecenas@temporaugueac.com',\n",
       "  83: 'in@est.ca',\n",
       "  84: 'Suspendisse@lectusNullam.co.uk',\n",
       "  85: 'nulla.ante@purus.net',\n",
       "  86: 'lobortis.mauris.Suspendisse@seddolor.org',\n",
       "  87: 'vitae@miac.edu',\n",
       "  88: 'vel.venenatis.vel@orcilobortis.net',\n",
       "  89: 'sit.amet@tinciduntvehicularisus.org',\n",
       "  90: 'adipiscing@Duisdignissimtempor.com',\n",
       "  91: 'semper.dui.lectus@rutrumnon.com',\n",
       "  92: 'Mauris.vestibulum.neque@odio.ca',\n",
       "  93: 'consectetuer@inmagnaPhasellus.edu',\n",
       "  94: 'eu.metus.In@magnis.edu',\n",
       "  95: 'euismod.est@cursusinhendrerit.edu',\n",
       "  96: 'orci.Phasellus@enim.org',\n",
       "  97: 'augue@vitae.edu',\n",
       "  98: 'mi.lorem@Maurismolestie.co.uk',\n",
       "  99: 'faucibus.ut.nulla@dapibus.ca'}}"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "full_data"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "832cc136",
   "metadata": {},
   "source": [
    "## 1.question 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "ca4ff748",
   "metadata": {},
   "outputs": [],
   "source": [
    "countries = []\n",
    "for country in full_data['Country'].values():\n",
    "    countries.append(country.replace(\",\",\"\"))\n",
    "sorted_country = sorted(set(countries))\n",
    "cfile = open('question_1.csv','w',newline='')\n",
    "writer = csv.writer(cfile)\n",
    "for country in sorted_country:\n",
    "    writer.writerow([country])\n",
    "cfile.close()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "88ac8d8f",
   "metadata": {},
   "source": [
    "## 2.question 2"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b12ce987",
   "metadata": {},
   "source": [
    "## assumption\n",
    "The email address consists of two parts, separated by @, the first is the user name, and the back is the domain name."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "1f18e7d3",
   "metadata": {},
   "outputs": [],
   "source": [
    "emails = full_data['Email']\n",
    "sorted_emails = []\n",
    "for email in emails.values():\n",
    "    sorted_emails.append(email.split(\"@\")[1])\n",
    "    sorted_emails=sorted(set(sorted_emails))\n",
    "cfile = open('question_2.csv','w',newline='')\n",
    "writer = csv.writer(cfile)\n",
    "for email in sorted_emails:\n",
    "    writer.writerow([email])\n",
    "cfile.close()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f4c195ba",
   "metadata": {},
   "source": [
    "## 3.question 3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "3c8e7ebb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Name': {'0': 'Hillary Benton',\n",
       "  '1': 'Morgan Y. Little',\n",
       "  '2': 'Camden Z. Blair',\n",
       "  '3': 'Alexandra E. Saunders',\n",
       "  '4': 'Hanae P. Walsh',\n",
       "  '5': 'Jescie Sargent',\n",
       "  '6': 'Kessie Morgan',\n",
       "  '7': 'Bevis M. Santos',\n",
       "  '8': 'Flynn Alston',\n",
       "  '9': 'Charles F. Crawford',\n",
       "  '10': 'Cairo Wolfe',\n",
       "  '11': 'Elijah Myers',\n",
       "  '12': 'Thane Burch',\n",
       "  '13': 'Katelyn Munoz',\n",
       "  '14': 'Genevieve Holland',\n",
       "  '15': 'Wesley Z. Sharp',\n",
       "  '16': 'Tatyana H. French',\n",
       "  '17': 'Meredith F. Clayton',\n",
       "  '18': 'Rajah Carrillo',\n",
       "  '19': 'Gabriel Richmond',\n",
       "  '20': 'Paul Merrill',\n",
       "  '21': 'Brynne S. Barr',\n",
       "  '22': 'Cyrus Buckley',\n",
       "  '23': 'Chloe Burnett',\n",
       "  '24': 'Zachery Wilcox',\n",
       "  '25': 'Casey Mcgowan',\n",
       "  '26': 'Cole X. Hopper',\n",
       "  '27': 'Tara Bender',\n",
       "  '28': 'Malik Grimes',\n",
       "  '29': 'Ulla Russo',\n",
       "  '30': 'Colby Moran',\n",
       "  '31': 'Maggy Wooten',\n",
       "  '32': 'Cameron Guthrie',\n",
       "  '33': 'Gail Villarreal',\n",
       "  '34': 'Harding Salinas',\n",
       "  '35': 'Idona W. Bonner',\n",
       "  '36': 'Warren Castillo',\n",
       "  '37': 'Clayton Harmon',\n",
       "  '38': 'Alana Vasquez',\n",
       "  '39': 'Mason R. Trujillo',\n",
       "  40: 'Garrison Lindsey',\n",
       "  41: 'Jenna Mercado',\n",
       "  42: 'Drake Savage',\n",
       "  43: 'Rana Z. Colon',\n",
       "  44: 'Melodie Knox',\n",
       "  45: 'Cooper T. Horton',\n",
       "  46: 'Eaton Nelson',\n",
       "  47: 'Lucian W. Lynn',\n",
       "  48: 'Sydney Anderson',\n",
       "  49: 'Jane Joyner',\n",
       "  50: 'Yen P. Browning',\n",
       "  51: 'Katell Simmons',\n",
       "  52: 'Freya B. Fischer',\n",
       "  53: 'Rama W. Mack',\n",
       "  54: 'Lawrence Z. Carrillo',\n",
       "  55: 'Quyn Serrano',\n",
       "  56: 'Indira L. Mccormick',\n",
       "  57: 'Rina W. Harris',\n",
       "  58: 'Cherokee George',\n",
       "  59: 'Michael Riddle',\n",
       "  60: 'Kay Rice',\n",
       "  61: 'Arden Leonard',\n",
       "  62: 'Chantale Sharpe',\n",
       "  63: 'Calvin Herman',\n",
       "  64: 'Walter R. Gaines',\n",
       "  65: 'Berk Finley',\n",
       "  66: 'Timothy Chambers',\n",
       "  67: 'Ariana M. Olson',\n",
       "  68: 'Mason E. Kelly',\n",
       "  69: 'Keane Stein',\n",
       "  70: 'Ginger Morse',\n",
       "  71: 'Maggy Cotton',\n",
       "  72: 'Talon R. May',\n",
       "  73: 'Devin L. Boone',\n",
       "  74: 'Orli E. Baxter',\n",
       "  75: 'Wing Velazquez',\n",
       "  76: 'Inez Simon',\n",
       "  77: 'Kyle Leonard',\n",
       "  78: 'Selma Christensen',\n",
       "  79: 'Gwendolyn Crosby',\n",
       "  80: 'Gary Alvarez',\n",
       "  81: 'Knox L. Cash',\n",
       "  82: 'Drake P. Guerrero',\n",
       "  83: 'Blossom Chandler',\n",
       "  84: 'Joan O. Ingram',\n",
       "  85: 'Buffy R. Austin',\n",
       "  86: 'Yoko M. Mcgowan',\n",
       "  87: 'Walker Q. Wolfe',\n",
       "  88: 'Blake Cross',\n",
       "  89: 'Naida Guthrie',\n",
       "  90: 'Yardley Singleton',\n",
       "  91: 'Lenore M. Boyer',\n",
       "  92: 'Edan Cortez',\n",
       "  93: 'Quintessa T. Martinez',\n",
       "  94: 'Reuben Skinner',\n",
       "  95: 'Yoshio Leblanc',\n",
       "  96: 'Rebecca French',\n",
       "  97: 'Shana K. Kerr',\n",
       "  98: 'Gemma Leonard',\n",
       "  99: 'Adara Estrada'},\n",
       " 'Phone': {'0': '1-243-669-7472',\n",
       "  '1': '155-3483',\n",
       "  '2': '123-5058',\n",
       "  '3': '1-637-740-7614',\n",
       "  '4': '901-2461',\n",
       "  '5': '265-1176',\n",
       "  '6': '945-0713',\n",
       "  '7': '227-9994',\n",
       "  '8': '398-8097',\n",
       "  '9': '791-5111',\n",
       "  '10': '1-930-942-2322',\n",
       "  '11': '1-238-336-4864',\n",
       "  '12': '1-894-978-3696',\n",
       "  '13': '220-5054',\n",
       "  '14': '992-6968',\n",
       "  '15': '1-960-740-2261',\n",
       "  '16': '1-120-782-6047',\n",
       "  '17': '425-7583',\n",
       "  '18': '1-576-789-5730',\n",
       "  '19': '1-387-932-2096',\n",
       "  '20': '1-313-739-3854',\n",
       "  '21': '939-4818',\n",
       "  '22': '266-3123',\n",
       "  '23': '828-0406',\n",
       "  '24': '1-611-756-4723',\n",
       "  '25': '1-155-558-4461',\n",
       "  '26': '1-328-505-0545',\n",
       "  '27': '1-757-378-4079',\n",
       "  '28': '793-4359',\n",
       "  '29': '662-7778',\n",
       "  '30': '1-788-230-1991',\n",
       "  '31': '912-7242',\n",
       "  '32': '988-2217',\n",
       "  '33': '1-405-823-4207',\n",
       "  '34': '1-505-843-5401',\n",
       "  '35': '283-6921',\n",
       "  '36': '1-250-875-9104',\n",
       "  '37': '1-609-380-9257',\n",
       "  '38': '1-853-288-4269',\n",
       "  '39': '172-5777',\n",
       "  40: '420-1477',\n",
       "  41: '102-2189',\n",
       "  42: '1-790-105-7695',\n",
       "  43: '486-7539',\n",
       "  44: '1-479-861-6093',\n",
       "  45: '768-1000',\n",
       "  46: '746-8562',\n",
       "  47: '1-392-783-0634',\n",
       "  48: '1-610-717-0447',\n",
       "  49: '1-131-574-3183',\n",
       "  50: '473-1433',\n",
       "  51: '1-647-852-3590',\n",
       "  52: '514-9914',\n",
       "  53: '1-849-217-6292',\n",
       "  54: '352-3711',\n",
       "  55: '1-450-807-5530',\n",
       "  56: '1-330-764-3846',\n",
       "  57: '760-1654',\n",
       "  58: '1-722-165-1370',\n",
       "  59: '476-0145',\n",
       "  60: '477-5481',\n",
       "  61: '383-6541',\n",
       "  62: '1-600-834-9076',\n",
       "  63: '1-461-665-6848',\n",
       "  64: '370-5831',\n",
       "  65: '1-765-752-4793',\n",
       "  66: '819-2872',\n",
       "  67: '447-5000',\n",
       "  68: '1-896-767-7525',\n",
       "  69: '457-2683',\n",
       "  70: '1-228-310-1687',\n",
       "  71: '1-541-405-3049',\n",
       "  72: '143-7688',\n",
       "  73: '1-132-242-8605',\n",
       "  74: '371-7491',\n",
       "  75: '354-5776',\n",
       "  76: '461-0691',\n",
       "  77: '179-3944',\n",
       "  78: '978-6407',\n",
       "  79: '692-9172',\n",
       "  80: '1-692-738-4449',\n",
       "  81: '535-9704',\n",
       "  82: '250-6382',\n",
       "  83: '142-2607',\n",
       "  84: '1-889-203-6592',\n",
       "  85: '413-3678',\n",
       "  86: '1-731-637-5890',\n",
       "  87: '1-240-595-6907',\n",
       "  88: '979-7498',\n",
       "  89: '1-138-699-9182',\n",
       "  90: '945-1641',\n",
       "  91: '513-0044',\n",
       "  92: '1-223-433-5209',\n",
       "  93: '1-672-341-8336',\n",
       "  94: '1-790-135-9618',\n",
       "  95: '1-508-613-2127',\n",
       "  96: '397-3408',\n",
       "  97: '354-7392',\n",
       "  98: '175-7956',\n",
       "  99: '1-893-111-1453'},\n",
       " 'Address': {'0': '144-1225 In Road',\n",
       "  '1': 'Ap #909-6656 Ac St.',\n",
       "  '2': 'P.O. Box 441, 6183 Ligula St.',\n",
       "  '3': '305-496 Morbi Rd.',\n",
       "  '4': '7058 Dapibus St.',\n",
       "  '5': '421-5501 Cursus. St.',\n",
       "  '6': 'Ap #481-6631 Vehicula Rd.',\n",
       "  '7': 'P.O. Box 575, 4033 Mi St.',\n",
       "  '8': 'Ap #763-5990 Nec, Av.',\n",
       "  '9': 'Ap #841-1623 Vitae Avenue',\n",
       "  '10': '9269 Libero Ave',\n",
       "  '11': 'P.O. Box 677, 2311 Aliquet. Road',\n",
       "  '12': '7438 Amet, Rd.',\n",
       "  '13': 'P.O. Box 432, 9085 Nulla Ave',\n",
       "  '14': '1768 Magna. Road',\n",
       "  '15': 'P.O. Box 497, 8354 Habitant St.',\n",
       "  '16': '217-9163 Lobortis Road',\n",
       "  '17': 'Ap #929-9420 Vivamus Rd.',\n",
       "  '18': '910-8300 Varius Rd.',\n",
       "  '19': '7458 Sapien. St.',\n",
       "  '20': '916-8087 Vehicula Rd.',\n",
       "  '21': '878-2231 Suspendisse Rd.',\n",
       "  '22': 'P.O. Box 572, 7680 Ullamcorper Ave',\n",
       "  '23': '563-4105 Donec Avenue',\n",
       "  '24': '462-2112 In Rd.',\n",
       "  '25': '420-7327 Facilisis Street',\n",
       "  '26': '561-7476 Eget St.',\n",
       "  '27': '1247 Nonummy Rd.',\n",
       "  '28': 'Ap #603-3303 Libero. St.',\n",
       "  '29': 'P.O. Box 975, 4593 Ante. Street',\n",
       "  '30': '3696 Augue Ave',\n",
       "  '31': 'P.O. Box 365, 6109 Metus. Rd.',\n",
       "  '32': 'Ap #861-8699 Non Ave',\n",
       "  '33': '371-7266 Tortor Avenue',\n",
       "  '34': '4167 Nunc Ave',\n",
       "  '35': 'Ap #302-2966 Cum Av.',\n",
       "  '36': 'Ap #275-2917 Curabitur Rd.',\n",
       "  '37': '6930 Duis Road',\n",
       "  '38': '1511 Lobortis Ave',\n",
       "  '39': 'Ap #711-213 Sagittis Avenue',\n",
       "  40: 'P.O. Box 466, 7919 In Av.',\n",
       "  41: 'P.O. Box 484, 9648 Sit Avenue',\n",
       "  42: 'P.O. Box 254, 2688 Luctus, Street',\n",
       "  43: 'Ap #682-9992 Neque Rd.',\n",
       "  44: '245-8811 Ut St.',\n",
       "  45: 'P.O. Box 383, 139 A Ave',\n",
       "  46: '7989 Magna Rd.',\n",
       "  47: '7312 Tristique St.',\n",
       "  48: 'P.O. Box 720, 9179 Fermentum Street',\n",
       "  49: '200-5702 Mollis St.',\n",
       "  50: 'Ap #221-1593 Fringilla St.',\n",
       "  51: 'P.O. Box 133, 5382 Enim Ave',\n",
       "  52: 'Ap #869-5869 Neque Avenue',\n",
       "  53: '2992 Vitae Rd.',\n",
       "  54: '6427 Eros Avenue',\n",
       "  55: 'P.O. Box 133, 6862 Diam Road',\n",
       "  56: 'P.O. Box 679, 7373 Mollis Ave',\n",
       "  57: 'P.O. Box 642, 2289 Volutpat. Street',\n",
       "  58: '221-3908 Pellentesque Av.',\n",
       "  59: '581-1223 Aliquam Rd.',\n",
       "  60: '2398 Lectus, Road',\n",
       "  61: '1274 Nullam St.',\n",
       "  62: '1229 Nisl. Av.',\n",
       "  63: '263-4846 Sed St.',\n",
       "  64: '3247 Parturient Ave',\n",
       "  65: '6138 Faucibus Ave',\n",
       "  66: '865-2066 Vel Rd.',\n",
       "  67: '173-4952 Pede, Avenue',\n",
       "  68: '593 Turpis. Av.',\n",
       "  69: '567-6664 Egestas St.',\n",
       "  70: 'P.O. Box 618, 8055 Integer St.',\n",
       "  71: '7304 Euismod Avenue',\n",
       "  72: '890-4439 Varius. Avenue',\n",
       "  73: '1488 Dignissim Ave',\n",
       "  74: '1506 Egestas Rd.',\n",
       "  75: '859-3576 Tincidunt Street',\n",
       "  76: 'Ap #788-4701 Aliquet St.',\n",
       "  77: '685-2553 Ultrices Avenue',\n",
       "  78: 'Ap #595-189 Malesuada Road',\n",
       "  79: '997 Posuere Rd.',\n",
       "  80: 'Ap #890-8397 Euismod Ave',\n",
       "  81: 'P.O. Box 469, 4278 Condimentum Rd.',\n",
       "  82: '6247 Aliquet Av.',\n",
       "  83: '7121 Diam. Rd.',\n",
       "  84: '8198 Curae; Av.',\n",
       "  85: '203-4493 A Road',\n",
       "  86: 'P.O. Box 881, 7563 Nisl. Av.',\n",
       "  87: '482-4531 Mauris Rd.',\n",
       "  88: 'Ap #678-3509 Nascetur Av.',\n",
       "  89: 'P.O. Box 656, 5397 Gravida. Ave',\n",
       "  90: 'Ap #815-7648 Non Rd.',\n",
       "  91: 'Ap #836-7039 Lorem Avenue',\n",
       "  92: '159-6608 Eu, St.',\n",
       "  93: '8916 Pede St.',\n",
       "  94: 'Ap #810-9918 Enim Street',\n",
       "  95: '177-9263 Vitae Ave',\n",
       "  96: '870-7596 Eros Rd.',\n",
       "  97: 'Ap #215-8596 Cursus Ave',\n",
       "  98: 'P.O. Box 634, 4298 Elit. Rd.',\n",
       "  99: '624-5679 Nulla. Rd.'},\n",
       " 'City': {'0': 'Navsari',\n",
       "  '1': 'Kitimat',\n",
       "  '2': 'Casanova Elvo',\n",
       "  '3': 'Biggleswade',\n",
       "  '4': 'Dhuy',\n",
       "  '5': 'Tulsa',\n",
       "  '6': 'Pedro Aguirre Cerda',\n",
       "  '7': 'Saint-Vincent',\n",
       "  '8': 'Tir煤a',\n",
       "  '9': 'Hindupur',\n",
       "  '10': 'Whitchurch',\n",
       "  '11': 'Port Harcourt',\n",
       "  '12': 'Algeciras',\n",
       "  '13': 'Requ铆noa',\n",
       "  '14': 'Moose Jaw',\n",
       "  '15': 'Bear',\n",
       "  '16': 'Salles',\n",
       "  '17': 'Friedberg',\n",
       "  '18': 'Bertiolo',\n",
       "  '19': 'Tropea',\n",
       "  '20': 'Le Mans',\n",
       "  '21': 'Wilhelmshaven',\n",
       "  '22': 'Sangli',\n",
       "  '23': 'Wabamun',\n",
       "  '24': 'Barddhaman',\n",
       "  '25': 'Pfungstadt',\n",
       "  '26': 'Saint John',\n",
       "  '27': 'Avellino',\n",
       "  '28': 'Winnipeg',\n",
       "  '29': 'Vitória da Conquista',\n",
       "  '30': 'Hualpén',\n",
       "  '31': 'Kapuskasing',\n",
       "  '32': 'Pontypridd',\n",
       "  '33': 'Saint-Remy-Geest',\n",
       "  '34': 'Arsimont',\n",
       "  '35': 'Nieuwenrode',\n",
       "  '36': 'La Baie',\n",
       "  '37': 'College',\n",
       "  '38': 'Richmond Hill',\n",
       "  '39': 'Quinta Normal',\n",
       "  40: 'Dunbar',\n",
       "  41: 'Pollena Trocchia',\n",
       "  42: 'Hastings',\n",
       "  43: 'Gespeg',\n",
       "  44: 'Whitehorse',\n",
       "  45: 'Fernie',\n",
       "  46: 'Ludlow',\n",
       "  47: 'Tirrases',\n",
       "  48: 'Ingolstadt',\n",
       "  49: 'HavrŽ',\n",
       "  50: 'Gentbrugge',\n",
       "  51: 'Rionero in Vulture',\n",
       "  52: 'Pudahuel',\n",
       "  53: 'Moricone',\n",
       "  54: 'Northumberland',\n",
       "  55: 'Lagonegro',\n",
       "  56: 'Rampur',\n",
       "  57: 'Dolceacqua',\n",
       "  58: 'Ourense',\n",
       "  59: 'Logan City',\n",
       "  60: 'Rutten',\n",
       "  61: 'Esslingen',\n",
       "  62: 'Windsor',\n",
       "  63: 'Castel Maggiore',\n",
       "  64: 'Kitchener',\n",
       "  65: 'Cavallino',\n",
       "  66: 'Dordrecht',\n",
       "  67: 'Zwevegem',\n",
       "  68: 'Fraser-Fort George',\n",
       "  69: 'Burgos',\n",
       "  70: 'Bosa',\n",
       "  71: 'Sommariva Perno',\n",
       "  72: 'Richmond',\n",
       "  73: 'Teruel',\n",
       "  74: 'Piła',\n",
       "  75: 'Oostkamp',\n",
       "  76: 'Chaitén',\n",
       "  77: 'Placilla',\n",
       "  78: 'Mira Bhayandar',\n",
       "  79: 'San Miguel',\n",
       "  80: 'Westende',\n",
       "  81: 'Gönen',\n",
       "  82: 'Caerphilly',\n",
       "  83: 'Illapel',\n",
       "  84: 'Baton Rouge',\n",
       "  85: 'Herentals',\n",
       "  86: 'Bihain',\n",
       "  87: 'Schepdaal',\n",
       "  88: 'Albany',\n",
       "  89: 'Tulita',\n",
       "  90: 'Duffel',\n",
       "  91: 'Attimis',\n",
       "  92: 'High Level',\n",
       "  93: 'Rothesay',\n",
       "  94: 'Essex',\n",
       "  95: 'Redwater',\n",
       "  96: 'Pocatello',\n",
       "  97: 'Toronto',\n",
       "  98: 'Cuccaro Vetere',\n",
       "  99: 'Gijzelbrechtegem'},\n",
       " 'Country': {'0': 'Togo',\n",
       "  '1': 'Nauru',\n",
       "  '2': 'Palestine, State of',\n",
       "  '3': 'Malawi',\n",
       "  '4': 'Qatar',\n",
       "  '5': 'Holy See (Vatican City State)',\n",
       "  '6': 'Bonaire, Sint Eustatius and Saba',\n",
       "  '7': 'Kuwait',\n",
       "  '8': 'Romania',\n",
       "  '9': 'South Georgia and The South Sandwich Islands',\n",
       "  '10': 'Lesotho',\n",
       "  '11': 'Kyrgyzstan',\n",
       "  '12': 'Anguilla',\n",
       "  '13': 'Congo (Brazzaville)',\n",
       "  '14': 'Uruguay',\n",
       "  '15': 'Cayman Islands',\n",
       "  '16': 'Eritrea',\n",
       "  '17': 'Czech Republic',\n",
       "  '18': 'Afghanistan',\n",
       "  '19': 'Cambodia',\n",
       "  '20': 'Somalia',\n",
       "  '21': 'Samoa',\n",
       "  '22': 'Taiwan',\n",
       "  '23': 'Morocco',\n",
       "  '24': 'Hong Kong',\n",
       "  '25': 'Iran',\n",
       "  '26': 'Macao',\n",
       "  '27': 'Dominica',\n",
       "  '28': 'Congo (Brazzaville)',\n",
       "  '29': 'Slovakia',\n",
       "  '30': 'France',\n",
       "  '31': 'Indonesia',\n",
       "  '32': 'Turks and Caicos Islands',\n",
       "  '33': 'Marshall Islands',\n",
       "  '34': 'Montserrat',\n",
       "  '35': 'Faroe Islands',\n",
       "  '36': 'Ireland',\n",
       "  '37': 'United States',\n",
       "  '38': 'Israel',\n",
       "  '39': 'Sudan',\n",
       "  40: 'Zambia',\n",
       "  41: 'Burkina Faso',\n",
       "  42: 'Tunisia',\n",
       "  43: 'Canada',\n",
       "  44: 'Norway',\n",
       "  45: 'Israel',\n",
       "  46: 'Cocos (Keeling) Islands',\n",
       "  47: 'Western Sahara',\n",
       "  48: 'Saint Vincent and The Grenadines',\n",
       "  49: 'Austria',\n",
       "  50: 'Isle of Man',\n",
       "  51: 'Hong Kong',\n",
       "  52: 'Rwanda',\n",
       "  53: 'Jamaica',\n",
       "  54: 'Latvia',\n",
       "  55: 'Ireland',\n",
       "  56: 'Saint Pierre and Miquelon',\n",
       "  57: 'Ghana',\n",
       "  58: 'Ukraine',\n",
       "  59: 'Guatemala',\n",
       "  60: 'Isle of Man',\n",
       "  61: 'Italy',\n",
       "  62: 'Mauritius',\n",
       "  63: 'Romania',\n",
       "  64: 'Niger',\n",
       "  65: 'Chile',\n",
       "  66: 'Egypt',\n",
       "  67: 'Dominican Republic',\n",
       "  68: 'Uganda',\n",
       "  69: 'Turks and Caicos Islands',\n",
       "  70: 'Anguilla',\n",
       "  71: 'Kyrgyzstan',\n",
       "  72: 'Turkmenistan',\n",
       "  73: 'Switzerland',\n",
       "  74: 'Croatia',\n",
       "  75: 'Mayotte',\n",
       "  76: 'Antigua and Barbuda',\n",
       "  77: 'Botswana',\n",
       "  78: 'Montserrat',\n",
       "  79: 'Albania',\n",
       "  80: 'Dominican Republic',\n",
       "  81: 'American Samoa',\n",
       "  82: 'Guyana',\n",
       "  83: 'Czech Republic',\n",
       "  84: 'Wallis and Futuna',\n",
       "  85: 'Iraq',\n",
       "  86: 'Guinea',\n",
       "  87: 'Moldova',\n",
       "  88: 'Sint Maarten',\n",
       "  89: 'Sudan',\n",
       "  90: 'Botswana',\n",
       "  91: 'Venezuela',\n",
       "  92: 'Algeria',\n",
       "  93: 'Tajikistan',\n",
       "  94: 'Bahamas',\n",
       "  95: 'Bahamas',\n",
       "  96: 'Northern Mariana Islands',\n",
       "  97: 'Estonia',\n",
       "  98: 'Saudi Arabia',\n",
       "  99: 'Kyrgyzstan'},\n",
       " 'Email': {'0': 'rutrum.magna.Cras@eudolor.edu',\n",
       "  '1': 'pede.sagittis.augue@quis.ca',\n",
       "  '2': 'consectetuer.rhoncus.Nullam@ultrices.org',\n",
       "  '3': 'dui.Fusce@duinecurna.org',\n",
       "  '4': 'Morbi@tinciduntpedeac.com',\n",
       "  '5': 'non.egestas.a@ullamcorper.co.uk',\n",
       "  '6': 'est@vitaeeratVivamus.net',\n",
       "  '7': 'Nunc@Aliquamfringilla.com',\n",
       "  '8': 'Nunc.pulvinar@Phasellusdapibus.edu',\n",
       "  '9': 'dis.parturient@nectellusNunc.net',\n",
       "  '10': 'sociis.natoque@arcuVestibulumante.org',\n",
       "  '11': 'tempus.risus@posuereat.net',\n",
       "  '12': 'lobortis.quis.pede@Namligula.edu',\n",
       "  '13': 'Vivamus.nisi.Mauris@fermentumarcu.edu',\n",
       "  '14': 'Maecenas.malesuada@euultrices.co.uk',\n",
       "  '15': 'et@sedsapien.ca',\n",
       "  '16': 'Curabitur@magna.com',\n",
       "  '17': 'elit.pharetra@dui.co.uk',\n",
       "  '18': 'sapien.gravida.non@cursuset.net',\n",
       "  '19': 'nunc.nulla.vulputate@anteblanditviverra.co.uk',\n",
       "  '20': 'diam.Pellentesque@suscipitest.ca',\n",
       "  '21': 'euismod.et.commodo@nisi.co.uk',\n",
       "  '22': 'accumsan.laoreet.ipsum@Quisqueimperdiet.ca',\n",
       "  '23': 'nec.orci.Donec@Suspendisse.co.uk',\n",
       "  '24': 'eget@tinciduntaliquamarcu.com',\n",
       "  '25': 'tellus.faucibus.leo@Sedpharetrafelis.org',\n",
       "  '26': 'urna@Lorem.net',\n",
       "  '27': 'libero.Integer@ligulaelitpretium.org',\n",
       "  '28': 'Donec.nibh.enim@consectetuercursuset.org',\n",
       "  '29': 'mauris.sit.amet@blanditatnisi.ca',\n",
       "  '30': 'eu@Aenean.edu',\n",
       "  '31': 'facilisis.eget.ipsum@consequat.com',\n",
       "  '32': 'ipsum@liberoDonec.net',\n",
       "  '33': 'Curabitur.dictum.Phasellus@maurisipsum.edu',\n",
       "  '34': 'Fusce.aliquam@velesttempor.edu',\n",
       "  '35': 'elementum.lorem@convallisdolor.co.uk',\n",
       "  '36': 'Aenean@ametrisus.com',\n",
       "  '37': 'bibendum@interdumfeugiatSed.edu',\n",
       "  '38': 'faucibus.id.libero@egestas.net',\n",
       "  '39': 'egestas@malesuadamalesuadaInteger.ca',\n",
       "  40: 'ipsum.ac@quam.net',\n",
       "  41: 'Nulla.facilisis.Suspendisse@urnanec.net',\n",
       "  42: 'quis.accumsan.convallis@fringilla.edu',\n",
       "  43: 'rutrum.non.hendrerit@etlacinia.com',\n",
       "  44: 'arcu@laciniaorciconsectetuer.ca',\n",
       "  45: 'sit@eros.ca',\n",
       "  46: 'eu@aenim.ca',\n",
       "  47: 'purus.Duis.elementum@ut.org',\n",
       "  48: 'ante.ipsum.primis@ornare.org',\n",
       "  49: 'magna.sed.dui@diamPellentesquehabitant.com',\n",
       "  50: 'enim@nuncinterdum.edu',\n",
       "  51: 'dui.lectus@erat.org',\n",
       "  52: 'Cras@dictumeu.org',\n",
       "  53: 'neque.vitae@nullamagna.edu',\n",
       "  54: 'Integer.vitae@arcu.org',\n",
       "  55: 'tincidunt@egestasadui.co.uk',\n",
       "  56: 'eleifend@purus.ca',\n",
       "  57: 'eget.venenatis.a@Curae.com',\n",
       "  58: 'amet.risus@risusaultricies.co.uk',\n",
       "  59: 'In@ornarelectusjusto.net',\n",
       "  60: 'ornare@egestas.co.uk',\n",
       "  61: 'pede.Suspendisse.dui@ullamcorper.ca',\n",
       "  62: 'Suspendisse.commodo.tincidunt@placerat.ca',\n",
       "  63: 'iaculis.lacus@ipsumprimis.com',\n",
       "  64: 'sit@risusDonec.net',\n",
       "  65: 'sapien.molestie@nonbibendum.edu',\n",
       "  66: 'purus.sapien@odioAliquamvulputate.edu',\n",
       "  67: 'augue.malesuada@magnisdisparturient.co.uk',\n",
       "  68: 'Maecenas.mi@tortordictumeu.org',\n",
       "  69: 'rhoncus.Donec@placerataugueSed.com',\n",
       "  70: 'in@eratEtiam.net',\n",
       "  71: 'amet@facilisisvitae.ca',\n",
       "  72: 'sit.amet.nulla@orciluctus.org',\n",
       "  73: 'nec.tempus.scelerisque@ettristiquepellentesque.ca',\n",
       "  74: 'eget.tincidunt@Curabiturvellectus.net',\n",
       "  75: 'consequat.nec.mollis@vitaeodiosagittis.edu',\n",
       "  76: 'laoreet@magnaUt.org',\n",
       "  77: 'Ut.nec@pedeSuspendissedui.edu',\n",
       "  78: 'ut@Maecenasiaculis.co.uk',\n",
       "  79: 'molestie.orci.tincidunt@feugiat.org',\n",
       "  80: 'Donec@consequat.co.uk',\n",
       "  81: 'nunc@erat.co.uk',\n",
       "  82: 'Maecenas@temporaugueac.com',\n",
       "  83: 'in@est.ca',\n",
       "  84: 'Suspendisse@lectusNullam.co.uk',\n",
       "  85: 'nulla.ante@purus.net',\n",
       "  86: 'lobortis.mauris.Suspendisse@seddolor.org',\n",
       "  87: 'vitae@miac.edu',\n",
       "  88: 'vel.venenatis.vel@orcilobortis.net',\n",
       "  89: 'sit.amet@tinciduntvehicularisus.org',\n",
       "  90: 'adipiscing@Duisdignissimtempor.com',\n",
       "  91: 'semper.dui.lectus@rutrumnon.com',\n",
       "  92: 'Mauris.vestibulum.neque@odio.ca',\n",
       "  93: 'consectetuer@inmagnaPhasellus.edu',\n",
       "  94: 'eu.metus.In@magnis.edu',\n",
       "  95: 'euismod.est@cursusinhendrerit.edu',\n",
       "  96: 'orci.Phasellus@enim.org',\n",
       "  97: 'augue@vitae.edu',\n",
       "  98: 'mi.lorem@Maurismolestie.co.uk',\n",
       "  99: 'faucibus.ut.nulla@dapibus.ca'}}"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "full_data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "e9c91502",
   "metadata": {},
   "outputs": [],
   "source": [
    "names = full_data[\"Name\"]\n",
    "address = full_data['Address']\n",
    "no_box_names = []\n",
    "for name, add in zip(names.values(),address.values()):\n",
    "    if 'P.O. Box' not in add:\n",
    "        no_box_names.append(name.split()[0])\n",
    "sorted_names = sorted(no_box_names)\n",
    "cfile = open('question_3.csv','w',newline='')\n",
    "writer = csv.writer(cfile)\n",
    "for name in sorted_names:\n",
    "    writer.writerow([name])\n",
    "cfile.close()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "36346830",
   "metadata": {},
   "source": [
    "## 4.question 4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "79d99cd4",
   "metadata": {},
   "outputs": [],
   "source": [
    "names = full_data[\"Name\"]\n",
    "countries = full_data[\"Country\"]\n",
    "name_country = []\n",
    "for item in zip(names.values(), countries.values()):\n",
    "    name_country.append(item)\n",
    "five_names =  sorted(name_country, key=lambda x:x[1])[:5]\n",
    "cfile = open('question_4.csv','w',newline='')\n",
    "writer = csv.writer(cfile)\n",
    "for name in five_names:\n",
    "    writer.writerow([name[0]])\n",
    "cfile.close()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8c3299c5",
   "metadata": {},
   "source": [
    "## 5.question 5"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8098fca6",
   "metadata": {},
   "source": [
    "## assumption\n",
    "#### 1.replace - to \"\"\n",
    "##### 2.convert string type to integer"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "c2ae3869",
   "metadata": {},
   "outputs": [],
   "source": [
    "names = full_data[\"Name\"]\n",
    "phone = full_data[\"Phone\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "id": "d3a61d6b",
   "metadata": {},
   "outputs": [],
   "source": [
    "phone_num = []\n",
    "for p in phone.values():\n",
    "    phone_num.append(int(p.replace(\"-\",\"\")))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "id": "9245f9ea",
   "metadata": {},
   "outputs": [],
   "source": [
    "name_phone = []\n",
    "for i in zip(names.values(), phone_num):\n",
    "    name_phone.append(i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "id": "9e13bbaa",
   "metadata": {},
   "outputs": [],
   "source": [
    "sorted_phone = sorted(name_phone, key=lambda x: x[1])[:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f14310e7",
   "metadata": {},
   "outputs": [],
   "source": [
    "cfile = open('question_.csv','w',newline='')\n",
    "writer = csv.writer(cfile)\n",
    "for name in sorted_phone:\n",
    "    writer.writerow([name[0]])\n",
    "cfile.close()\n",
    "    "
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
